#pragma once
#include<iostream>
#include"Chair.h"
#include"Table.h"
class Furniture {
public:
	virtual Chair* CreateChair()const = 0;
	virtual Table* CreateTable()const = 0;
	void print()const {
		Chair* chair = this->CreateChair();
		Table* table = this->CreateTable();
		cout << "Made a " << chair->UseFunc() << " and " << table->UseFunc() << " ";
		delete chair;
		delete table;
	}
};
class ModernFurniture :public Furniture {
public:
	Chair* CreateChair()const override {
		return new ModernChair;
	}
	Table* CreateTable()const override {
		return new ModernTable;
	}
};
class ArtFurniture :public Furniture {
public:
	Chair* CreateChair()const override {
		return new ArtChair;
	}
	Table* CreateTable()const override {
		return new ArtTable;
	}
};
